package com.tang.portal.facade.admin.sys;

import com.tang.framework.core.domain.HttpResult;
import com.tang.framework.core.facade.Facade;
import com.tang.common.model.req.ReqPage;
import com.tang.portal.component.harbor.HarborArtifactService;
import com.tang.portal.component.harbor.HarborRepositoryService;
import com.tang.portal.component.harbor.model.Repository;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author tang jun liang
 * @Date 2023/6/21 9:52
 */
@Service
public class HarborFacade extends Facade {

    @Resource
    private HarborArtifactService harborArtifactService;

    @Resource
    private HarborRepositoryService harborRepositoryService;

    public HttpResult<List<Map<?, ?>>> artifacts(String projectName, String repositoryName) {
        return ok(harborArtifactService.artifacts(projectName, repositoryName));
    }


    public HttpResult<List<Repository>> repositories(String projectName, ReqPage page) {
        return ok(harborRepositoryService.repositories(projectName, page));
    }
}
